<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>






<link href="../style/cssqt.css" rel="stylesheet" type="text/css" />
</head>

<body>
<p>
  <?php
include("../config/config.php");
$lenh = "select * from donhang";
$kq = mysql_query($lenh);

$kq = mysql_query($lenh);
$sodong = 16;
$sodulieu = mysql_num_rows($kq);
$sotrang = ceil($sodulieu/$sodong);
if(!$_GET["p"])
$p =1;
else
$p = $_GET["p"];
$x = ($p-1)*$sodong;

$lenh1 = "select * from donhang limit $x,$sodong";
$kq1=mysql_query($lenh1);

?>
</p>
<form id="form1" name="form1" method="post" action="">
  <table width="1110" border="1" cellspacing="0" cellpadding="0" class="table_khachhang">
    <tr>
      <td height="30" colspan="11" align="center" class="title_table"><strong>Thông Tin Đặt Hàng</strong></td>
    </tr>
    <tr>
      <td height="30"><strong>STT</strong></td>
      <td height="30"><strong>idDH</strong></td>
      <td height="30"><strong>MaKH</strong></td>
      <td height="30"><strong>Thời điểm đặt hàng</strong></td>
      <td height="30"><strong>Thời điểm giao hàng</strong></td>
      <td height="30"><strong>Địa điểm giao hàng</strong></td>
      <td height="30"><strong>Tên người nhận</strong></td>
      <td height="30"><strong>Số điện thoại</strong></td>
      <td height="30"><strong>Số CMND</strong></td>
     	<td height="30"><strong>Xem</strong></td>
      <td height="30"><strong>Xóa</strong></td>
    </tr>
    <?php
	$stt=$x+1;
	while($row = mysql_fetch_array($kq1))
	{
		if($row[9]==1)
	  $tinhtrang= "Đã thanh toán";
	  else
	  $tinhtrang = "Chưa thánh toán";
		?>
    <tr>
    	<td height="30"><?php echo $stt; ?></td>  
        <td height="30"><?php echo $row[0]; ?></td>
        <td height="30"><?php echo $row[1]; ?></td>
        <td height="30"><?php echo $row[2]; ?></td>
        <td height="30"><?php echo $row[3]; ?></td>
        <td height="30"><?php echo $row[4]; ?></td>
        <td height="30"><?php echo $row[5]; ?></td>
        <td height="30"><?php echo $row[6]; ?></td>
        <td height="30"><?php echo $row[7]; ?></td>
      <td><a href="indexqt.php?idxem=<?php echo $row[0]; ?>">Xem</a></td>
        
      <td align="center"><a href="xoadathang.php?idxoa=<?php echo $row[0]; ?>">Xóa</a></td>
    </tr>
    
    <?php
	$stt++;
	}
	?>
  </table>
  
  <p align="center">
<?php
for($i = 1; $i <= $sotrang; $i++)
{
	if($p==$i)
	{
		echo "&nbsp;".$i."&nbsp;";
	}
	else
	{
		?>
    <a href="indexqt.php?act=qldh&p=<?php  echo $i;   ?>"><?php  echo $i;  ?></a>
    
    
    <?php
	}		
}
?>
  </p>
  <p align="center">
  <font color="#FF0000">Số đặt hàng hiện tại là :</font> <?php  echo $sodulieu;     ?>
</p>
</form>
<p>&nbsp;</p>
</body>
</html>